{% extends "base.html" %}
{% import "bootstrap/wtf.html" as wtf %}

{% block title %} {{ super() }} - {% if cam_name %}{{ cam_name }} {% endif %} 相机 {% endblock %}

{% block page_content %}
<div class="page-header">
    <h1>视频流：</h1>
    <img src="{{ url_for('.video_feed',cam_id=cam_id) }}">
</div>

{% if btns %}
    {% for btn in btns %}
    <div id="{{ btn['id'] }}" >
        <button type="button" class="btn btn-primary" data-loading-text="Loading..."> {{ btn['name'] }} </button>
    </div>
    {% endfor %}
{% endif %}
{% endblock %}

{% block scripts %}
{{ super() }}
<script type="text/javascript">
{% if btns %}
{% for btn in btns %}
    $(function(){
        $("#{{ btn['id'] }} .btn").click(function(){
            // REST get 方法获取指定的资源
            $.get("{{ btn['api']|safe }}",function(data,status){
                });
            $(this).button('reset')
        });
    });
{% endfor %}
{% endif %}
</script>
{% endblock %}
